Device discovery is a well-known and widely used component of many existing wireless technologies, including ad hoc and cellular networks. Examples of technologies and/or standards, in which device discovery is used, include Bluetooth and several variants of the Institute of Electrical and Electronics Engineers (IEEE) 802.11 standards suite, such as WI-FI DIRECT® technology. These systems operate in unlicensed spectrum.
Recently, Device-to-Device (D2D) communications as an underlay to communications in a cellular network have been proposed as a means to take advantage of the proximity of communicating devices and at the same time to allow devices to operate in a controlled interference environment. Typically, such D2D communication shares the same spectrum as the cellular network. As an example, some resources of the cellular network's uplink resources may be reserved for D2D communication. Allocating a dedicated spectrum for D2D communication is a less likely alternative as spectrum is a scarce resource and dynamic sharing between services utilising D2D communication and services utilising cellular communication is more flexible. Hence, the spectrum can be more efficiently used. For D2D communication to occur, a viable solution is that terminals involved in the D2D communication have the same understanding of uplink (UL) subframe timing as the cellular network and that D2D operations primarily occur in the UL spectrum or in the UL resources of the overlying cellular system. Such a synchronized solution allows for at least partially predictable interference between D2D and cellular operations.
Cellular systems often define multiple states for the terminal matching different transmission activities. In Long Term Evolution (LTE), two states are defined:                1. RRC_IDLE, where the terminal is not connected to a particular cell and no data transfer in either uplink or downlink may occur. The terminal is in Discontinuous Reception (DRX) most of the time except for occasionally monitoring the paging channel.        2. RRC_CONNECTED, where the terminal is connected to a known cell and can receive downlink transmissions.        
Although RRC_CONNECTED is not specified as having sub states in the official specifications, RRC_CONNECTED may be considered to have two sub states:                2.1 UL_IN_SYNC, where the terminal has a valid timing advance value such that uplink transmissions can be received without collisions between different terminals        2.2 UL_OUT_OF_SYNC, where the terminal does not have a valid timing advance value and hence cannot transmit data in the uplink. Prior to any transmission, a random access is performed to synchronize the uplink.        
In LTE, random access is used to achieve uplink time synchronization for a user equipment (UE) which either has not yet acquired or has lost its uplink synchronization. Once uplink synchronization is achieved for a UE, an eNodeB (eNB) can schedule orthogonal uplink transmission resources for it.
For D2D communication, it is necessary to define the transmission and reception timing. In principle, any transmission timing could be used as long as transmissions do not interfere with cellular communication. However, an attractive approach is to use the same transmission timing at the terminal for D2D transmissions as for cellular uplink transmissions. This ensures that D2D transmissions do no collide with uplink transmissions from the same device and avoids a (potentially complicated) additional timing advance mechanism for direct D2D communication.
The term ‘cellular’ may in the following be extended to out-of-network coverage scenario, where the terminals may establish a hierarchical structure consisting of a cluster head (CH) and slaves controlled by the CH. In this way, the CH in many respects behaves similar to an eNB and the concept of ‘cluster’ can be seen as the ‘cell’ in a traditional cellular network. Hence, in the following text, the term ‘cellular’ can be also applied to the hierarchical structure of CH/Slaves.
When considering the out-of-coverage scenario in more detail, no assistance can be expected from the eNB. Hence, if a first user equipment has data to send to a second user equipment, and possibly other user equipments, a D2D communication needs to be performed for sending of the data. A possible way of triggering such D2D communication is that the first user equipment broadcasts a preamble, or beacon, that points to some fixed resources, which are to be used when sending the data. The fixed resources are statically defined by e.g. a standard specification. In this manner, resources for data may be provided while still keeping control signalling from e.g. a cluster head low. When many user equipments attempt to send data at the same time on these fixed resources, a problem may be that interference from the respective transmissions of data makes it difficult for, e.g. the second user equipment to decode the transmission and thereby obtain the data.